#include <iostream>

#include "XML_Document.h"

XML_Document::XML_Document()
{
	this->dtd_name = "";
	this->dtd_file = "";
	this->root = NULL;
}

XML_Document::~XML_Document()
{
	delete this->root;
}

void XML_Document::setDTD( string dtd_name, string dtd_file)
{
	this->dtd_name = dtd_name;
	this->dtd_file = dtd_file;
}

void XML_Document::setRoot(XML_Element * root)
{
	this->root = root;
}

string XML_Document::toString()
{
	string s = ( "<!DOCTYPE " + dtd_name + " SYSTEM \"" + dtd_file + "\">" + '\n' );
    s += root->toString( 0 );

    return s;
}

